import 'package:flutter/cupertino.dart';
import 'package:tencent_kit/tencent_kit.dart';

class TencentUtils {
  static Future<bool> isInstalled(Tencent tencent) async {
    return await tencent.isQQInstalled() || await tencent.isTIMInstalled();
  }

  static Future<void> registerApp(
    Tencent tencent, {
    @required String appId,
    @required String universalLink,
  }) {
    return tencent.registerApp(
      appId: appId,
      universalLink: universalLink,
    );
  }

  static Future<void> shareWebpage(
    Tencent tencent, {
    @required int scene,
    @required String title,
    String summary,
    Uri imageUri,
    @required String targetUrl,
    String appName,
    int extInt = TencentQZoneFlag.AUTO_OPEN,
  }) {
    return tencent.shareWebpage(
      scene: scene,
      title: title,
      summary: summary,
      imageUri: imageUri,
      targetUrl: targetUrl,
      appName: appName,
      extInt: extInt,
    );
  }
}
